<?php

/**
 * ReferralFriend form.
 *
 * @package    docplus.co.za
 * @subpackage form
 * @author     Fox Matuku
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class ReferralFriendForm extends BaseReferralFriendForm
{

    public function configure()
    {
        unset(
            $this['created_at'], $this['updated_at']
        );

        if ($cardinal = $this->getOption('cardinal'))
        {
            $this->widgetSchema['referral_id'] = new sfWidgetFormInputHidden();
            $this->widgetSchema['name']->setLabel($cardinal . ' friend name');
            $this->widgetSchema['email']->setLabel($cardinal . ' friend email');
            $this->validatorSchema['referral_id'] = new sfValidatorString(array('required' => false));
            $this->validatorSchema['name'] = new sfValidatorString(array('max_length' => 255, 'required' => true), array('required' => 'Your * '. $cardinal . ' friend name* is required.'));
            $this->validatorSchema['email'] = new sfValidatorEmail(array("required" => true), array("invalid" => 'Your * '. $cardinal . ' friend email* is invalid.', "required" => 'The * '. $cardinal . ' friend email* is required.'));
        }
        
        $this->disableCSRFProtection();
    }

}
